import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ProductContentAppBar extends StatefulWidget {
  @override
  _ProductContentAppBarState createState() => _ProductContentAppBarState();
}

class _ProductContentAppBarState extends State<ProductContentAppBar> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: AppBar(
        title: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Container(
              width: 400.w,
              child: TabBar(
                isScrollable:true,
                indicatorColor: Colors.red,
                indicatorSize: TabBarIndicatorSize.label,
                tabs: <Widget>[
                  Tab(
                    child: Text('商品'),
                  ),
                  Tab(
                    child: Text('详情'),
                  ),
                  Tab(
                    child: Text('评价'),
                  )
                ],
              ),
            )
          ],
        ),
        actions: <Widget>[
          IconButton(
            icon: Icon(Icons.more_horiz),
            onPressed: () {
              showMenu(
                  context: context,
                  position: RelativeRect.fromLTRB(
                      600.w, 76, 10, 0),
                  items: [
                    PopupMenuItem(
                      child: Row(
                        children: <Widget>[Icon(Icons.home), Text("首页")],
                      ),
                    ),
                    PopupMenuItem(
                      child: Row(
                        children: <Widget>[Icon(Icons.search), Text("搜索")],
                      ),
                    )
                  ]);
            },
          )
        ],
      ),
    );
  }
}
